//----------------Sonic CD Water Splash Script----------------//
//--------Scripted by Christian Whitehead 'The Taxman'--------//
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//

// Aliases
#alias Object.Value0	:	Object.Timer

sub ObjectMain
	Object.iYPos = Stage.WaterLevel
	
	Object.Timer++
	if Object.Timer > 4
		Object.Timer = 0
		Object.Frame++
		if Object.Frame > 5
			Object.Type = TypeName[Blank Object]
		end if
	end if
end sub


sub ObjectDraw
	DrawSprite(Object.Frame)
end sub


sub ObjectStartup
	LoadSpriteSheet("R4.5/Water.gif")

	SpriteFrame(-16, -8, 32, 8, 0, 69)		// #0 - WaterSplash frame 0
	SpriteFrame(-16, -32, 32, 32, 33, 35)  	// #1 - WaterSplash frame 1
	SpriteFrame(-16, -64, 32, 64, 132, 35) 	// #2 - WaterSplash frame 2
	SpriteFrame(-16, -48, 32, 48, 99, 35) 	// #3 - WaterSplash frame 3
	SpriteFrame(-16, -32, 32, 32, 66, 35)	// #4 - WaterSplash frame 4
	SpriteFrame(-16, -16, 32, 16, 0, 52)	// #5 - WaterSplash frame 5
end sub


// ========================
// Editor Subs
// ========================

sub RSDKDraw
	DrawSprite(0)
end sub


sub RSDKLoad
	LoadSpriteSheet("R4.5/Water.gif")

	SpriteFrame(-16, -64, 32, 64, 132, 35) 	// #0 - WaterSplash frame 2

	SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
end sub
